﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace AKJ.Sharepoint.Branding.Config
{
    public class RebrandPathElement : ConfigurationElement
    {
        public RebrandPathElement()
        { }

        [ConfigurationProperty("Path", IsRequired = true)]        
        public string Path
        {
            get { return this["Path"] as string; }
            set { this["Path"] = value as string; }
        }

        [ConfigurationProperty("IncludeLayoutsFolder")]
        public bool IncludelayoutsFolder
        {
            get { return (bool)this["IncludeLayoutsFolder"]; }
            set { this["IncludeLayoutsFolder"] = value; }
        }
                        
        [ConfigurationProperty("Priority")]        
        public int Priority
        {
            get { return (int)this["Priority"]; }
            set { this["Priority"] = value; }
        }

        [ConfigurationProperty("ApplyMaster")]
        public ApplyMasterElement ApplyMaster
        {
            get { return this["ApplyMaster"] as ApplyMasterElement; }
            set { this["ApplyMaster"] = value as ApplyMasterElement; }
        }

        [ConfigurationProperty("ApplyCss")]
        public ApplyCssElement ApplyCss
        {
            get { return this["ApplyCss"] as ApplyCssElement; }
            set { this["ApplyCss"] = value as ApplyCssElement; }
        }
    }

    public class ApplyMasterElement : ConfigurationElement
    {
        public ApplyMasterElement()
        { }

        [ConfigurationProperty("File", IsRequired = true)]
        public string File
        {
            get { return this["File"] as string; }
            set { this["File"] = value as string; }
        }

        [ConfigurationProperty("ApplyOnlyTo")]
        public string ApplyOnlyTo
        {
            get { return this["ApplyOnlyTo"] as string; }
            set { this["ApplyOnlyTo"] = value as string; }
        }  
    }

    public class QuerystringElement : ConfigurationElement
    {
        public QuerystringElement()
        { }

        [ConfigurationProperty("Parameter", IsRequired = true)]
        public string Parameter
        {
            get { return this["Parameter"] as string; }
            set { this["Parameter"] = value as string; }
        }

        [ConfigurationProperty("Value")]
        public string Value
        {
            get { return this["Value"] as string; }
            set { this["Value"] = value as string; }
        }

        [ConfigurationProperty("ApplyMaster")]
        public ApplyMasterElement ApplyMaster
        {
            get { return this["ApplyMaster"] as ApplyMasterElement; }
            set { this["ApplyMaster"] = value as ApplyMasterElement; }
        }

        [ConfigurationProperty("ApplyCss")]
        public ApplyCssElement ApplyCss
        {
            get { return this["ApplyCss"] as ApplyCssElement; }
            set { this["ApplyCss"] = value as ApplyCssElement; }
        }
    }

    public class ApplyCssElement : ConfigurationElement
    {
        public ApplyCssElement()
        { }

        [ConfigurationProperty("File", IsRequired = true)]
        public string File
        {
            get { return this["File"] as string; }
            set { this["File"] = value as string; }
        }        
    }

    public class ReplaceMasterElement : ConfigurationElement
    {
        public ReplaceMasterElement()
        { }

        [ConfigurationProperty("Path", IsRequired = true)]
        public string Path
        {
            get { return this["Path"] as string; }
            set { this["Path"] = value as string; }
        }

        [ConfigurationProperty("From", IsRequired = true)]
        public string From
        {
            get { return this["From"] as string; }
            set { this["From"] = value as string; }
        }

        [ConfigurationProperty("To", IsRequired = true)]
        public string To
        {
            get { return this["To"] as string; }
            set { this["To"] = value as string; }
        }
    }

    public class RedirectElement : ConfigurationElement
    {
        public RedirectElement()
        { }

        [ConfigurationProperty("From", IsRequired = true)]
        public string From
        {
            get { return this["From"] as string; }
            set { this["From"] = value as string; }
        }

        [ConfigurationProperty("To", IsRequired = true)]
        public string To
        {
            get { return this["To"] as string; }
            set { this["To"] = value as string; }
        }
    }

    public class BrandingInterceptorElement : ConfigurationElement
    {
        public BrandingInterceptorElement()
        { }

        [ConfigurationProperty("Type", IsRequired = true)]
        public string Type
        {
            get { return this["Type"] as string; }
            set { this["Type"] = value as string; }
        }

        [ConfigurationProperty("Assembly", IsRequired = true)]
        public string Assembly
        {
            get { return this["Assembly"] as string; }
            set { this["Assembly"] = value as string; }
        }

        [ConfigurationProperty("Priority", IsRequired = true)]
        public string Priority
        {
            get { return this["Priority"] as string; }
            set { this["Priority"] = value as string; }
        }
    }

    

}
